package com.cmyshare.design.strategyAndFactorySpring;

/**
 * @version 1.0
 * @Author cmy
 * @Date 2025/10/13 16:21
 * @desc 银联支付实现
 */
@Service("UNIONPAY")
public class UnionPayStrategy implements PaymentStrategy {

    @Override
    public PaymentResult pay(PaymentRequest request) {
        // 实际项目中这里会调用银联支付API
        System.out.println("执行银联支付: 订单" + request.getOrderId() +
                ", 金额" + request.getAmount() + "元");

        // 模拟支付结果
        return new PaymentResult(true, "银联支付成功",
                "UNIONPAY" + System.currentTimeMillis());
    }
}

